package com.ynt.pay.user.controller;

import com.ynt.pay.user.api.dto.UserListDto;
import com.ynt.pay.user.api.rest.UserRemoteClient;
import com.ynt.pay.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户服务
 *
 * @Author: ganbo
 * @Date: 2019/11/21 19:49
 */

@RestController
@RequestMapping("/user")
public class UserController implements UserRemoteClient {

    @Value("${server.port}")
    private String port;

    @Autowired
    UserService userService;

    public List<UserListDto> list() {
        return userService.list();
    }

    public String hello() {
        return "访问服务端口是:" + port;
    }

}
